<!DOCTYPE html>
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登录页</title>
    <link rel="stylesheet" href="../css/normalize.min.css">
    <link rel="stylesheet" href="../css/style.css">
</head>
<body><!-- partial:index.partial.html -->
<div class="container right-panel-active"><!-- Sign Up -->
    <div class="container__form container--signup">
        <form class="form" id="form1" th:action="@{/signup}" th:object="${user}">
            <h2 class="form__title" >注 册</h2>
            <input type="text" placeholder="用户名" class="input" th:field="*{name}">
            <input type="password" placeholder="密码" class="input" th:field="*{password}">
            <input type="text" placeholder="电话号码" class="input" th:field="*{tel}">
            <button class="btn" id="submit_btn1">注 册</button>
        </form>
    </div><!-- Sign In -->
    <div class="container__form container--signin">
        <form th:action="@{/login}"  th:object="${user}" class="form" id="form2">
            <h2 class="form__title">登 录</h2>
            <input type="text" th:field="*{name}" placeholder="用户名" class="input" id="username">
            <input type="password" th:field="*{password}" placeholder="密码" class="input" id="pwd">
            <a href="http://localhost:8080/tofindpwd" class="link">忘记密码?</a>
            <button class="btn" id="submit_btn2">登 录</button>
        </form>
    </div><!-- Overlay -->
    <div class="container__overlay">
        <div class="overlay">
            <div class="overlay__panel overlay--left">
                <button class="btn" id="signIn">登 录</button>
            </div>
            <div class="overlay__panel overlay--right">
                <button class="btn" id="signUp">注 册</button>
            </div>
        </div>
    </div>
</div><!-- partial -->
<script src="../js/script.js"></script>
<script type="text/javascript">
    window.onload=function(){
        var btn2=document.getElementById('submit_btn2');
        var form2=document.getElementById('form2');

        var btn1=document.getElementById('submit_btn1');
        var form1=document.getElementById('form1');
        btn1.onclick=function() {
            form1.submit();
        }
        btn2.onclick=function(){
            form2.submit();
        }
    }

</script>
</body>
</html>